local caijvewanxv = fk.CreateSkill{
  name = "caijvewanxv",
}

Fk:loadTranslationTable{
  ["caijvewanxv"] = "裁决万序",
  [":caijvewanxv"] = "每回合限一次，你可以弃置一张牌，令你的追击触发时额外弃对方一张牌，持续一回合。",
  ["@caijvewanxv"] = "裁决万序",
}

caijvewanxv:addEffect("active", {
    anim_type = "support",
    mute = true,
    card_num = 1,
    target_num = 1,
  can_use = function(self, player)
    return player:usedSkillTimes(self.name, Player.HistoryPhase) == 0
    and player:hasSkill(self.name)
    and #player:getCardIds("h") > 0
  end,
    card_filter = function(self, player, to_select, selected)
      return #selected == 0
  end,
  on_use = function(self, room, effect,target,player)
    local player = effect.from
    local room = player.room
    room:throwCard(effect.cards, self.name, player, player)
    room:setPlayerMark(player, "@caijvewanxv", 1)
  end,
})


caijvewanxv:addEffect(fk.TurnStart, {
  anim_type = "support",
    mute = true,
  can_trigger = function(self, event, target, player, data)
    return player:hasSkill(self.name)
    and (target == player or player.dead)
    and player:getMark("@caijvewanxv",player) > 0
  end,
  on_cost = function(self, event, target, player, data)
    return true
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    room:setPlayerMark(player, "@caijvewanxv", 0)
  end,
})

return caijvewanxv 